// websocket客户端
const WebSocket = require('ws')
const wss = new WebSocket('ws://127.0.0.1:7000')
wss.on('open', function () {
  for (var i = 0; i < 3; i++) {
    wss.send('Hello from client:' + i)
  }
  wss.on('message', function (msg) {
    console.log(JSON.parse(msg))
  })
})
